package com.junlong0716.enjoylearning.manager

import android.content.Context
import android.graphics.drawable.Drawable
import android.net.Uri
import android.widget.ImageView
import com.htxcsoft.corelibrary.glide.GlideUtils
import com.zhihu.matisse.engine.ImageEngine

/**
 *@author: 巴黎没有摩天轮Li
 *@description:
 *@date: Created in 下午4:09 2018/6/2
 *@modified by:
 */
class MatisseGlideManager: ImageEngine {
    override fun loadAnimatedGifThumbnail(context: Context?, resize: Int, placeholder: Drawable?, imageView: ImageView?, uri: Uri?) {
        GlideUtils.showImage(context!!,uri,imageView!!)
    }

    override fun loadImage(context: Context?, resizeX: Int, resizeY: Int, imageView: ImageView?, uri: Uri?) {
        GlideUtils.showImage(context!!,uri,imageView!!)
    }

    override fun loadAnimatedGifImage(context: Context?, resizeX: Int, resizeY: Int, imageView: ImageView?, uri: Uri?) {
        GlideUtils.showImage(context!!,uri,imageView!!)
    }

    override fun supportAnimatedGif(): Boolean = true

    override fun loadThumbnail(context: Context?, resize: Int, placeholder: Drawable?, imageView: ImageView?, uri: Uri?) {
        imageView!!.scaleType = ImageView.ScaleType.CENTER
        GlideUtils.showImage(context!!,uri,imageView)
    }

}